﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Pay.Data {
	public class SkuInfoMap
		: System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<SkuInfo> {
		public SkuInfoMap() {
			// table
			ToTable("mc_SkuInfo");

			// keys
			HasKey(t => t.Id);

			// Properties
			Property(t => t.Id)
				.HasColumnName("Id")
				.HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
				.IsRequired();
			Property(t => t.MerchantId)
				.HasColumnName("MerchantId")
				.IsRequired();
			Property(t => t.Name)
				.HasColumnName("Name")
				.HasMaxLength(100)
				.IsRequired();

			// Relationships
		}
	}
}
